import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import Class from './views/Class'
import Head from './views/Head'
import My from './views/My'
import Order from './views/Order'
import NotFound from './views1/NotFound'

import Home from './views1/Home'
import News from './views1/News'
import Sports from './views1/Sports'
import SpHome from './views1/SpHome'
import AbroadSp from './views1/AbroadSp'
import ChineseSp from './views1/ChineseSp'
Vue.config.productionTip = false
//使用路由插件
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/head'
  },
  {
    path:"/head",
    component:Head  
  },
  {
    path:"/class",
    component:Class
  },
  {
    path:'/my',
    component:My
  },
  {
    path:"/order",
    component:Order
  },
  {
    path:'/home',
    component:Home
  },
  {
    path:'/news',
    component:News
  },
  {
    path:'/sports',
    component:Sports,
    children:[
      {
        path:'',
        redirect:'sphome'
      },
      {
        path:'abroadsp',
        component:AbroadSp
      },
      {
        path:'chinesesp',
        component:ChineseSp
      },
      {
        path:'sphome',
        component:SpHome
      }
    ]
  },
  {
    path:'*',
    component:NotFound
  }
]
const router = new VueRouter({
  routes
})
new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
